Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

to-absolute-glob

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-absolute-glob

Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-12.29%
Maintainers
3
Weekly downloads
 
Created

What is to-absolute-glob?

The to-absolute-glob package is used to convert glob patterns into absolute paths. This is particularly useful when working with file system operations that require absolute paths. The package ensures that the glob patterns are resolved to absolute paths based on the process's current working directory or a specified base directory.

What are to-absolute-glob's main functionalities?

Convert relative glob to absolute

This feature allows you to convert a relative glob pattern into an absolute path glob pattern. The 'cwd' option specifies the base directory from which the glob should be resolved.

const toAbsoluteGlob = require('to-absolute-glob');
const absoluteGlob = toAbsoluteGlob('*.js', { cwd: '/some/dir' });
console.log(absoluteGlob);

Handle negation patterns

The package can also handle negation patterns (patterns that start with '!') and convert them into absolute paths while preserving the negation.

const toAbsoluteGlob = require('to-absolute-glob');
const absoluteGlob = toAbsoluteGlob('!*.js', { cwd: '/some/dir' });
console.log(absoluteGlob);

Other packages similar to to-absolute-glob

Keywords

FAQs

Package last updated on 19 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc